﻿using project.B12.application.Ioc;
using project.B12.Model.Enums;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace project.B12.application.Extensions
{
    public class BooleanToAddContentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string add = null;
            string confirm = null;
            if (ViewModelLocator.PublicResourceViewModel.Language==LanguageEnum.Ch)
            {
                add = "新增";
                confirm = "确定";
            }
            else
            {
                add = "Add";
                confirm = "Confirm";
            }
            
            if (value is bool addContent)
                return addContent ? add : confirm;

            return string.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
